package com.guodefu.demo.enums;

/**
 * @description 字符串转日期时间，匹配表达式与应使用的格式的匹配关系
 * @author guodefu909
 * @date 2020-08-23 01:24:00
 */
public enum DateFormatEnum {

	DATE_POPULAR("^\\d{4}-\\d{1,2}-\\d{1,2}$", "yyyy-MM-dd"),

	TIME_POPULAR("^\\d{1,2}:\\d{1,2}:\\d{1,2}$", "HH:mm:ss"),

	DATE_TIME_POPULAR("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$", "yyyy-MM-dd HH:mm:ss"),

	DATE_SLASH("^\\d{4}/\\d{1,2}/\\d{1,2}$", "yyyy/MM/dd"),

	DATE_NO_SEPARATOR("^\\d{8}$", "yyyyMMdd"),
	;

	private final String matches;

	private final String pattern;

	public String getMatches() {
		return matches;
	}

	public String getPattern() {
		return pattern;
	}

	DateFormatEnum(String matches, String pattern) {
		this.matches = matches;
		this.pattern = pattern;
	}

}